/***************************************************************************
 *            index.c
 *
 *  Thu Oct  9 17:42:52 2008
 *  Copyright  2008  ra046802
 *  <ra046802@zero.lab.ic.unicamp.br>
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */
#include "index.h"
 
index_string * index_string_create(){
	return calloc(1,sizeof(index_string));
}

unsigned int index_string_add(index_string * i,char * string){
	unsigned int r=i->size;
	i->index=realloc(i->index,(++i->size)*sizeof(char *));
	i->index[r]=string;
	return r;
}

char * index_string_get(index_string * i,unsigned int index){
	return i->index[index];
}

void index_string_delete(index_string * i){
	unsigned int c=0,x=i->size;
	//while(c<x){
	//	free(i->index[c]);
	//}
	free(i);
}
